package app.view.component.movie 
{
	import com.greensock.TweenLite;
	import com.Utils;
	import flash.display.Graphics;
	import flash.display.MovieClip;
	import flash.events.Event;
	/**
	 * ...
	 * @author PHANCUONG87
	 */
	public class MayContainer extends MovieClip
	{
		private var may1:McMay;
		private var may2:McMay;
		
		public function MayContainer() 
		{
			this.addEventListener(Event.ADDED_TO_STAGE, addStage);
			
		}
		
		private function addStage(evt:Event):void 
		{
			this.removeEventListener(Event.ADDED_TO_STAGE, addStage);
			
			may1 = new McMay();
			may2 = new McMay();
			
			may1.name = "may1";
			may2.name = "may2";
			
			may1.x = stage.stageWidth ;
			may2.x = stage.stageWidth + 1000;
			
			may1.ot 	= { x:may1.x, y:may1.y };
			may1.oe 	= { x:-500, y:may1.y, delay:5 };
			
			may2.ot 	= { x:may1.x, y:may1.y };
			may2.oe 	= { x:-500, y:may1.y, delay:60 };
			
			this.addChild(may1);
			this.addChild(may2);
			
			this.addEventListener(Event.ENTER_FRAME, onenterFrame);
		}
		
		private function onenterFrame(evt:Event):void 
		{
			may1.x -= 1
			may2.x -= 1
			
			if (may1.x <= may1.oe.x ) may1.x = may1.ot.x;
			if (may2.x <= may2.oe.x ) may2.x = may2.ot.x;
		}
	}	

}